﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.MenuInfos
{
    public class MenuInfoConfig : IEntityTypeConfiguration<MenuInfo>
    {
        public void Configure(EntityTypeBuilder<MenuInfo> builder)
        {
            builder.HasComment("菜单表");
            builder.Property(x => x.ParentId).IsRequired().HasComment("父节点ID");
            builder.Property(x => x.MenuSort).IsRequired().HasComment("节点排序");
            builder.Property(x => x.MenuName).IsRequired().HasMaxLength(50).HasComment("菜单名称");
            builder.Property(x => x.MenuUrl).HasMaxLength(50).HasComment("菜单路由");
            builder.Property(x => x.MenuIcon).HasMaxLength(50).HasComment("菜单图标");
            builder.Property(x => x.MenuType).IsRequired().HasComment("节点排序");
            builder.Property(x => x.Enabled).IsRequired().HasComment("是否有效");
        }
    }

}
